import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'

class Login extends Component {
    login = () => {
        this.props.history.push(this.props.location.state.back)
        sessionStorage.setItem('token', "FDKJHLFKSSFL")
    }
    render() {
        console.log(this.props)
        return (
            <div>
                <p>
                    账号：<input type="text" />
                </p>
                <p>
                    密码：<input type="text" />
                </p>
                <button onClick = { this.login }>登录</button>
            </div>
        )
    }
}

export default withRouter(Login)